package com.tenebrous.jestic.service.framwork.system;

import com.tenebrous.jestic.entity.framwork.system.SysSchedule;
import com.tenebrous.jestic.mapper.idao.framwork.system.SysScheduleMapper;
import com.tenebrous.jestic.service.SuperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysScheduleService extends SuperService<SysSchedule> {

    @Autowired
    private SysScheduleMapper mapper;

    @Override
    @Autowired
    protected void setSuperMapper() {
        super.setSuperMapper(this.mapper);
    }

    public SysSchedule getByStime(String key, String userid) {
        List<SysSchedule> list = this.mapper.selectByStime(key, userid);
        if (list.size() > 0) {
            return list.get(0);
        }
        return null;
    }

    public List<SysSchedule> queryByStime(String key, String userid) {
        return this.mapper.selectByStime(key, userid);
    }

    public List queryList(String syear, String smonth, String userid) {
        return this.mapper.selectByCondition(syear, smonth, userid);
    }
}
